package com.aj.http.request;

import java.util.HashMap;

import android.content.Context;
import android.util.Log;

import com.aj.http.AsynchronizationHttpRequest;
import com.aj.http.AsynchronizationHttpRequest.IHttpCallBack;

public class CreateTaskRequest extends BaseRequset {
	private static final String TAG = CreateTaskRequest.class.getName();

	public void excute(Context context, String audioUrl, String imgUrl,
			String content, String fromUserId, String sendTime, String type,
			String toUserId, IHttpCallBack httpCallBack) {
		HashMap<String, String> paramsHashMap = new HashMap<String, String>();
		if (sendTime != null) {
			paramsHashMap.put("sendTime", sendTime);
		}
		if (type != null) {
			paramsHashMap.put("type", type);
		}
		if (toUserId != null) {
			paramsHashMap.put("toUserId", toUserId);
		}
		if (content != null) {
			paramsHashMap.put("content", content);
		}
		if (audioUrl != null) {
			paramsHashMap.put("audioUrl", audioUrl);
		} else {
			paramsHashMap.put("audioUrl", "");
		}
		if (imgUrl != null) {
			paramsHashMap.put("imgUrl", imgUrl);
		} else {
			paramsHashMap.put("imgUrl", "");
		}
		paramsHashMap.put("fromUserId", fromUserId);
		String tempString = getParams(SERVICE_TASK_ADD_STRING, paramsHashMap);
		Log.e(TAG, "tempString:" + tempString);
		// TODO加密
		AsynchronizationHttpRequest request = new AsynchronizationHttpRequest();
		request.excute(context, BASE_REQUEST_URL_NOPAGE_STRING, tempString,
				httpCallBack);
	}

}
